﻿#pragma once

#include "geom/geom_point.h"
#include "topo_base.h"

namespace CAGD
{

/**
 * 拓扑顶点.
 */
class TopoVertex : public TopoBase
{
  public:
    /**
     * @brief 数学点构造.
     * @see
     */
    TopoVertex(BPnt p);

    /**
     * @brief 几何点构造.
     * @see
     */
    TopoVertex(Handle(GeomPoint) p);

    /**
     * @brief 获得几何点.
     * @return
     * @see
     */
    Handle(GeomPoint) Geom() const;

    /**
     * @brief 获得所属边.
     * @return
     * @see
     */
    std::unordered_set<TopoEdge *> &Edges();

    /**
     * @brief 拓扑类型.
     * @return
     * @see
     */
    TopoType Type() const override;

  protected:
    Handle(GeomPoint) m_point;              // 坐标点
    std::unordered_set<TopoEdge *> m_edges; // 所属的 edges
};

} // namespace CAGD
